#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Create by zhang
# Create on 2022/6/29 21:16
from domain.report.common.period_enum import PeriodEnum
from domain.report.spider.pdf_report.sse.pdf_spider import download_report as sse_report
from domain.report.spider.pdf_report.szse.pdf_spider import download_report as szse_report
from infrastructure.util.dateutils import get_current_year, today


def report_spider(stock_code:str, year:int, period:PeriodEnum=PeriodEnum.all):
    if get_current_year() == year:
        pass
    stock_id, platform = stock_code.split(".")
    platform = str(platform).lower()
    if platform == "sz":
        return szse_report(stock_id, year, period)
    else:
        return sse_report(stock_id, year, period)
